<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<LINK href="showAllOrg.files/style.htm" rel=stylesheet>
		<LINK href="showAllOrg.files/content.htm" rel=stylesheet>
		
		<script type="text/javascript">
		    var djConfig = {
				isDebug:true,
				parseOnLoad:true,
				usePlainJson:true
		    };
		</script>
		 
		<script type="text/javascript" src="dojo/dojo/dojo.js"></script>
		<script type="text/javascript" src="dojo/dijit/dijit.js"></script>

		<script type="text/javascript">
    		dojo.require("dijit.form.Button");
    		dojo.require("dojo.rpc.JsonService");    	
    	</script>
    	<script language="JavaScript" type="text/javascript">
    		var orderBoxService = new dojo.rpc.JsonService("box/order/OrderBoxService?smd");
    		var orderPlanImportService = new dojo.rpc.JsonService("box/alloc/OrderPlanImportService?smd");
			var makeBoxAllocFormService = new dojo.rpc.JsonService("box/alloc/MakeBoxAllocFormService?smd");

    		//页面加载时的一些操作
			dojo.addOnLoad(load);
			function load() {
				initPage();
			}
			function initPage() {
				var statusName = ["", "等待回应", "未制十联单", "已制十联单", "订舱成功"];
				orderBoxService.queryAllocDetails("", "", "").addCallback(function (adList) {					
					console.dir(adList);
					var ad = adList.list;
					for (var i in ad) {
						orderPlanImportService.getOrderPlan(ad[i].BAFID).addCallback(function (orderPlan) {
							console.dir(orderPlan);
							var text = "";
							//text = text + "<tr class='gridtreven'>";
							text = text + "    <td align='center'><a href='#' onClick='";
							if (ad.status == 1) {	//等待回应
								text = text + "";
							} else if (ad.status == 2) {		//未制十联单
								text = text + "make_shipper_note()";
							} else if (ad.status == 3) {		//已制十联单
								text = text + "show_shipper_note()";
							} else {							//订舱成功
								text = text + "update_shipper_note(" + orderPlan.ID + ", " + ad[i].id + ")";
							}
							text = text + "'><img src='showAllOrg.files/cus.gif' border='0'/></a></td>";
							text = text + "<td align='left'>" + statusName[ad[i].status] + "</td>";
							text = text + "<td align='left'>" + ad[i].commission.id + "</td>";
							text = text + "<td align='left'>" + ad[i].BAFID + "</td>";
							text = text + "<td align='left'>" + ad[i].commission.sender.name + "</td>";
							text = text + "<td align='left'>" + orderPlan.shipSchedule.shipInfo.shipComInfo.shortTitle + "</td>";
							text = text + "<td align='left'>" + orderPlan.shipSchedule.shipInfo.name + "</td>";
							text = text + "<td align='left'>" + orderPlan.shipSchedule.id + "</td>";
							text = text + "<td align='left'>" + orderPlan.shipSchedule.leaveTimeString + "</td>";
							text = text + "<td align='left'>" + parseInt(ad[i].bigNum + ad[i].smallNum) + "</td>";
							text = text + "<td align='left'>否</td>";
							//text = text + "</tr>";

							var tr = document.createElement("tr");
							tr.className = "gridtreven";
							document.getElementById("resultTable").tBodies[0].appendChild(tr);
							tr.innerHTML = text;
						});
					}
				});
			}
			function make_shipper_note() {
			}
			function show_shipper_note() {
			}
			function update_shipper_note(orderPlanID, adId) {
				makeBoxAllocFormService.setBookBoxParams(orderPlanID.toString(), adId).addCallback(function () {
					//alert(orderPlanID);
					//alert(adId);
					window.open("更新十联单A.htm", "_self");
				});
			}
			function thisQuery() {
				var rows = document.getElementById("resultTable").tBodies[0].rows;
				for (var i = rows.length - 1; i > 0; i--) {
					var rIndex = rows[i].sectionRowIndex;
					rows[i].parentNode.deleteRow(rIndex);
				}

				var statusName = ["", "等待回应", "未制十联单", "已制十联单", "订舱成功"];
				orderBoxService.queryAllocDetails(document.getElementById("commId").value,
						document.getElementById("bafId").value,
						document.getElementById("senderName").value).addCallback(function (adList) {					
					console.dir(adList);
					var ad = adList.list;
					for (var i in ad) {
						orderPlanImportService.getOrderPlan(ad[i].BAFID).addCallback(function (orderPlan) {
							console.dir(orderPlan);
							if (document.getElementById("date").value == orderPlan.shipSchedule.leaveTimeString) {
								var text = "";
								//text = text + "<tr class='gridtreven'>";
								text = text + "    <td align='center'><a href='#' onClick='";
								if (ad.status == 1) {	//等待回应
									text = text + "";
								} else if (ad.status == 2) {		//未制十联单
									text = text + "make_shipper_note()";
								} else if (ad.status == 3) {		//已制十联单
									text = text + "show_shipper_note()";
								} else {							//订舱成功
									text = text + "update_shipper_note()";
								}
								text = text + "'><img src='showAllOrg.files/cus.gif' border='0'/></a></td>";
								text = text + "<td align='left'>" + statusName[ad[i].status] + "</td>";
								text = text + "<td align='left'>" + ad[i].commission.id + "</td>";
								text = text + "<td align='left'>" + ad[i].BAFID + "</td>";
								text = text + "<td align='left'>" + ad[i].commission.sender.name + "</td>";
								text = text + "<td align='left'>" + orderPlan.shipSchedule.shipInfo.shipComInfo.shortTitle + "</td>";
								text = text + "<td align='left'>" + orderPlan.shipSchedule.shipInfo.name + "</td>";
								text = text + "<td align='left'>" + orderPlan.shipSchedule.id + "</td>";
								text = text + "<td align='left'>" + orderPlan.shipSchedule.leaveTimeString + "</td>";
								text = text + "<td align='left'>" + parseInt(ad[i].bigNum + ad[i].smallNum) + "</td>";
								text = text + "<td align='left'>否</td>";
								//text = text + "</tr>";
	
								var tr = document.createElement("tr");
								tr.className = "gridtreven";
								document.getElementById("resultTable").tBodies[0].appendChild(tr);
								tr.innerHTML = text;
							}
						});
					}
				});
			}
			function thisReset() {
				document.getElementById("commId").value = "";
				document.getElementById("bafId").value = "";
				document.getElementById("senderName").value = "";
				document.getElementById("date").value = "";
			}
    	</script>
    	<title>订舱管理</title>
</HEAD>
<BODY><FONT style="FONT-SIZE: 18px" face=隶书 color=#3656b9 
;>订舱管理</FONT><BR><IMG src="showAllOrg.files/line2.gif"><BR>


<CENTER><!--查询操作表格-->
<TABLE cellSpacing=0 cellPadding=0 width=560 align=center border=0>
  <TBODY>
  <TR>
    <TD align=right><FONT class=redcolor face=Webdings>4</FONT><A 
      href="javascript:thisQuery()">查询</A>&nbsp;&nbsp; <FONT class=redcolor 
      face=Webdings>4</FONT><A href="javascript:thisReset()">重置</A> 
  </TD></TR></TBODY></TABLE>
  
<TABLE class=queryarea cellSpacing=2 cellPadding=2 width=600 align=center>
  <TBODY>
  <TR>
    <TD class=rtitle>委托单号:</TD>
    <TD class=ltitle><INPUT id="commId" class=linput name=query_orgID> 
    <TD class=rtitle>清单编号:</TD>
    <TD class=ltitle><INPUT id="bafId" class=linput name=query_orgName> </TD>
  <TR>
    <TD class=rtitle>发货人:</TD>
    <TD class=ltitle><INPUT id="senderName" class=linput name=query_type> 
    <TD class=rtitle>日期:</TD>
    <TD class=ltitle><INPUT id="date" class=linput name=query_father> </TD></TR>
  </TBODY></TABLE><BR><!--数据显示区表格，规定样式为class="gridarea" -->
  
<TABLE id="resultTable" class=gridarea cellSpacing=1 cellPadding=2 width=760 align=center><!--数据行标题-->
  <TR>
    <TD class=gridtitletd vAlign=middle width=47>操作 </TD>
	<TD class=gridtitletd vAlign=middle width=74>状态 </TD>
	<TD class=gridtitletd vAlign=middle width=67>委托单号</TD>
    <TD class=gridtitletd vAlign=middle width=62>清单编码</TD>
	<TD class=gridtitletd vAlign=middle width=46>发货人</TD>
    <TD class=gridtitletd vAlign=middle width=78>船公司名称</TD>
    <TD class=gridtitletd vAlign=middle width=50>船名</TD>
    <TD class=gridtitletd vAlign=middle width=44>船次</TD>
    <TD class=gridtitletd vAlign=middle width=68>日期</TD>
    <TD class=gridtitletd vAlign=middle width=35>箱数</TD>
	<TD class=gridtitletd vAlign=middle width=31>拼箱</TD>
    </TR>
  </TABLE>
<!--简单表翻页脚标。-->
<TABLE height=30 cellSpacing=0 cellPadding=0 width=660 align=center border=0>
  <TBODY>
  <TR>
    <TD align=left width=660><A href="javascript:%20firstPage()"><IMG 
      height=15 src="showAllOrg.files/first.gif" width=20 border=0></A><A 
      href="javascript:%20prevPage()"><IMG height=15 
      src="showAllOrg.files/first1.gif" width=20 border=0></A> <INPUT 
      class=linput onkeypress="return locate(this);" size=3 value=1> <A 
      href="javascript:%20nextPage()"><IMG height=15 
      src="showAllOrg.files/last1.gif" width=20 border=0></A><A 
      href="javascript:%20lastPage()"><IMG height=15 
      src="showAllOrg.files/last.gif" width=20 border=0></A>&nbsp; 第1页/共1页 
  </TD></TR></TBODY></TABLE>
<SCRIPT language=javascript>
function nextPage() {
  return;
}
function prevPage() {
  return;
}
function firstPage() {
  return;
}
function lastPage() {
  return;
}
//直接定位时调用
function locate(obj) 
{
  var tmpChar = window.event.keyCode;
  if (tmpChar == 13) 
  {
    var val = parseInt(obj.value);
    if (val>1 || val<1 || isNaN(val))  
    {
      alert("要查询的页面不存在!: " + obj.value);
      obj.value=1;
      return false;
    }
    document.formHidden.currentPage.value= val;
    document.formHidden.submit();
    return false;
  }
  else
  {
     if (tmpChar>47 && tmpChar<58) 
     {  
         return true;
     }  
     return false; 
  }  
}  
</SCRIPT>
</CENTER></BODY></HTML>
